/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Interface.Participante;

import static Interface.Global.aux;

import java.awt.Component;
import java.sql.Date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

import Modelo.Participante.Participante;
import Modelo.Pessoa.Pessoa;
import Util.ExcecaoInstanciaNaoEncontrada;
import java.util.ArrayList;

/**
 *
 * @author ana.siena
 */
public class AtualizarParticipante extends javax.swing.JFrame {
    
    //Variaveis
    private long codPessoa;
    private String nomePessoa;
    private String cpfPessoa;
    private String enderecoPessoa;
    private Calendar dataNascPessoa;
    private String emailPessoa;
    private String telefonePessoa;
    private long nroInscricao;
    private long codEvento;
    private long nroEdicao;
    private boolean tipoOuvinte;
    private boolean tipoApresentador;
    private boolean tipoOrganizador;
    private Participante part;
    private String nomeParticipante;
    private Pessoa pessoa;
    
    public AtualizarParticipante() {
        initComponents();
        init();
    }
    
    private void init(){
	setVisible(true);
        setTitle("Atualizar Participante");
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        novoTelefoneParticipante = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        novoEmailParticipante = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        novoEnderecoParticipante = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        novoDataNascParticipante = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        novoNomeParticipante = new javax.swing.JTextField();
        novoCpfParticipante = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        nomePartText = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        nroInscrCombo = new javax.swing.JComboBox();
        jPanel3 = new javax.swing.JPanel();
        telefoneParticipante1 = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        emailParticipante1 = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        enderecoParticipante1 = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        dataNascParticipante1 = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        nomeParticipante1 = new javax.swing.JTextField();
        cpfParticipante1 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        botaoRetorno2 = new javax.swing.JButton();
        botaoAtualizar = new javax.swing.JButton();
        botaoConsultar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados atualizados"));

        novoTelefoneParticipante.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                novoTelefoneParticipanteActionPerformed(evt);
            }
        });

        jLabel6.setText("Telefone:");

        jLabel5.setText("E-mail:");

        novoEmailParticipante.setToolTipText("");
        novoEmailParticipante.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                novoEmailParticipanteActionPerformed(evt);
            }
        });

        jLabel3.setText("Nome:");

        jLabel4.setText("CPF:");

        novoEnderecoParticipante.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                novoEnderecoParticipanteActionPerformed(evt);
            }
        });

        jLabel7.setText("Endereco:");

        novoDataNascParticipante.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                novoDataNascParticipanteActionPerformed(evt);
            }
        });

        jLabel8.setText("Nascimento:");

        novoNomeParticipante.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                novoNomeParticipanteActionPerformed(evt);
            }
        });

        novoCpfParticipante.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                novoCpfParticipanteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)
                            .addComponent(jLabel4)
                            .addComponent(jLabel8))
                        .addGap(10, 10, 10))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(37, 37, 37)))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(novoEmailParticipante)
                    .addComponent(novoTelefoneParticipante)
                    .addComponent(novoDataNascParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(novoCpfParticipante)
                    .addComponent(novoNomeParticipante)
                    .addComponent(novoEnderecoParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, 261, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(31, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(novoNomeParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(novoCpfParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(novoEnderecoParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(14, 14, 14)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(novoEmailParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(novoDataNascParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(novoTelefoneParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados do participante a ser buscado"));

        jLabel2.setText("Numero da inscrição:");

        nomePartText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nomePartTextActionPerformed(evt);
            }
        });

        jLabel15.setText("Nome do participante:");

        nroInscrCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nroInscrComboActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel15)
                    .addComponent(jLabel2))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(nomePartText, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(nroInscrCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(25, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nomePartText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(nroInscrCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(17, 17, 17))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados do participante buscado"));

        telefoneParticipante1.setEnabled(false);

        jLabel9.setText("Telefone:");

        jLabel10.setText("E-mail:");

        emailParticipante1.setToolTipText("");
        emailParticipante1.setEnabled(false);

        jLabel11.setText("Nome:");

        jLabel12.setText("CPF:");

        enderecoParticipante1.setEnabled(false);

        jLabel13.setText("Endereco:");

        dataNascParticipante1.setEnabled(false);
        dataNascParticipante1.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                dataNascParticipante1ActionPerformed(evt);
            }
        });

        jLabel14.setText("Nascimento:");

        nomeParticipante1.setEnabled(false);
        nomeParticipante1.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                nomeParticipante1ActionPerformed(evt);
            }
        });

        cpfParticipante1.setEnabled(false);
        cpfParticipante1.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                cpfParticipante1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel11)
                            .addComponent(jLabel9)
                            .addComponent(jLabel13)
                            .addComponent(jLabel12)
                            .addComponent(jLabel14))
                        .addGap(10, 10, 10))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addGap(37, 37, 37)))
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(emailParticipante1)
                    .addComponent(telefoneParticipante1)
                    .addComponent(dataNascParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cpfParticipante1)
                    .addComponent(nomeParticipante1)
                    .addComponent(enderecoParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, 261, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(nomeParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(cpfParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(enderecoParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(14, 14, 14)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(emailParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(dataNascParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(telefoneParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel1.setText("Atualizar um Participante");

        botaoRetorno2.setText("Retornar");
        botaoRetorno2.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoRetorno2ActionPerformed(evt);
            }
        });

        botaoAtualizar.setText("Atualizar");
        botaoAtualizar.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoAtualizarActionPerformed(evt);
            }
        });

        botaoConsultar.setText("Consultar");
        botaoConsultar.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoConsultarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(118, 118, 118)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(botaoRetorno2)
                                .addGap(8, 8, 8)
                                .addComponent(botaoConsultar)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(botaoAtualizar))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
                .addContainerGap(21, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoRetorno2)
                    .addComponent(botaoAtualizar)
                    .addComponent(botaoConsultar))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void novoDataNascParticipanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_novoDataNascParticipanteActionPerformed
        
    }//GEN-LAST:event_novoDataNascParticipanteActionPerformed

    private void novoNomeParticipanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_novoNomeParticipanteActionPerformed
        
    }//GEN-LAST:event_novoNomeParticipanteActionPerformed

    private void novoCpfParticipanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_novoCpfParticipanteActionPerformed
        
    }//GEN-LAST:event_novoCpfParticipanteActionPerformed

    private void dataNascParticipante1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataNascParticipante1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_dataNascParticipante1ActionPerformed

    private void nomeParticipante1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nomeParticipante1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_nomeParticipante1ActionPerformed

    private void cpfParticipante1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cpfParticipante1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cpfParticipante1ActionPerformed

    private void botaoRetorno2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoRetorno2ActionPerformed
        // TODO add your handling code here:
        new MenuParticipante().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_botaoRetorno2ActionPerformed

    private void botaoAtualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoAtualizarActionPerformed
 	
    	DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
        this.dataNascPessoa = Calendar.getInstance();
                try {
                    this.dataNascPessoa.setTime(df.parse(this.novoDataNascParticipante.getText()));
                } catch (ParseException ex) {
                    Logger.getLogger(AtualizarParticipante.class.getName()).log(Level.SEVERE, null, ex);
                    Component frame = null;
                    JOptionPane.showMessageDialog(frame,"Erro!");
                }
                
        this.nomePessoa = novoNomeParticipante.getText();
        this.cpfPessoa = novoCpfParticipante.getText();
        this.enderecoPessoa = novoEnderecoParticipante.getText();
        this.emailPessoa = novoEmailParticipante.getText();
        this.telefonePessoa = novoTelefoneParticipante.getText();
              
        //Guarda dados atualizados
        Pessoa novaPessoa = new Pessoa (pessoa.getCodPessoa(), nomePessoa, cpfPessoa,enderecoPessoa, dataNascPessoa, emailPessoa, telefonePessoa);
        try {
		aux.updatePessoa(novaPessoa);
	} catch (ExcecaoInstanciaNaoEncontrada e) {
		Component frame = null;
		JOptionPane.showMessageDialog(frame,e.getMessage());
	}
                
        Participante participante = new Participante(pessoa.getCodPessoa(), nomePessoa, cpfPessoa, enderecoPessoa, dataNascPessoa, emailPessoa, telefonePessoa, nroInscricao, part.getCodEvento(), part.getNroEdicao(), tipoOuvinte, tipoApresentador, tipoOrganizador);
        try {
            aux.updateParticipante(participante);
        } catch (ExcecaoInstanciaNaoEncontrada ex) {
            Logger.getLogger(AtualizarParticipante.class.getName()).log(Level.SEVERE, null, ex);
            Component frame = null;
            JOptionPane.showMessageDialog(frame,"Erro!");
        }
    }//GEN-LAST:event_botaoAtualizarActionPerformed

    private void botaoConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoConsultarActionPerformed
    	nroInscricao = (long) nroInscrCombo.getSelectedItem();
    	
    	try {
            this.part = aux.buscaParticipante(nroInscricao);
        } catch (ExcecaoInstanciaNaoEncontrada ex) {
            Logger.getLogger(ConsultarParticipante.class.getName()).log(Level.SEVERE, null, ex);
            Component frame = null;
            JOptionPane.showMessageDialog(frame,"Erro!");
        }
        try {
            //Manda imprimir os dados na tela
            this.pessoa = aux.buscaPessoa(part.getCodPessoa());
        } catch (ExcecaoInstanciaNaoEncontrada ex) {
            Logger.getLogger(ConsultarParticipante.class.getName()).log(Level.SEVERE, null, ex);
            Component frame = null;
            JOptionPane.showMessageDialog(frame,"Erro!");
        }
        
        //Imprimi dados atuais
        nomeParticipante1.setText(pessoa.getNomePessoa());
        cpfParticipante1.setText(pessoa.getCpfPessoa());
        enderecoParticipante1.setText(pessoa.getEnderecoPessoa());
        emailParticipante1.setText(pessoa.getEmailPessoa());
        DateFormat df = new SimpleDateFormat("MM/dd/yyyy");       
        String data = df.format(new Date(pessoa.getDataNascPessoa().getTimeInMillis()));
        dataNascParticipante1.setText(data);
        telefoneParticipante1.setText(pessoa.getTelefonePessoa());
        
        this.novoNomeParticipante.setText(pessoa.getNomePessoa());
        this.novoCpfParticipante.setText(pessoa.getCpfPessoa());
        this.novoEnderecoParticipante.setText(pessoa.getEnderecoPessoa());
        this.novoEmailParticipante.setText(pessoa.getEmailPessoa());
        this.novoDataNascParticipante.setText(data);
        this.novoTelefoneParticipante.setText(pessoa.getTelefonePessoa());
    }//GEN-LAST:event_botaoConsultarActionPerformed

    private void novoEnderecoParticipanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_novoEnderecoParticipanteActionPerformed
        
    }//GEN-LAST:event_novoEnderecoParticipanteActionPerformed

    private void novoEmailParticipanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_novoEmailParticipanteActionPerformed
        
    }//GEN-LAST:event_novoEmailParticipanteActionPerformed

    private void novoTelefoneParticipanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_novoTelefoneParticipanteActionPerformed
        
    }//GEN-LAST:event_novoTelefoneParticipanteActionPerformed

    private void nomePartTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nomePartTextActionPerformed
        nomeParticipante = nomePartText.getText();
        
        ArrayList <Long> vetorNroInscricao = new ArrayList <Long>();
        vetorNroInscricao = (ArrayList<Long>) aux.buscarParticipantePorNome(nomeParticipante);
        nroInscrCombo.removeAllItems();
        for(int i=0; i<vetorNroInscricao.size();i++)
        {
            nroInscrCombo.addItem(vetorNroInscricao.get(i));
        }
    }//GEN-LAST:event_nomePartTextActionPerformed

    private void nroInscrComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nroInscrComboActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_nroInscrComboActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botaoAtualizar;
    private javax.swing.JButton botaoConsultar;
    private javax.swing.JButton botaoRetorno2;
    private javax.swing.JTextField cpfParticipante1;
    private javax.swing.JTextField dataNascParticipante1;
    private javax.swing.JTextField emailParticipante1;
    private javax.swing.JTextField enderecoParticipante1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JTextField nomePartText;
    private javax.swing.JTextField nomeParticipante1;
    private javax.swing.JTextField novoCpfParticipante;
    private javax.swing.JTextField novoDataNascParticipante;
    private javax.swing.JTextField novoEmailParticipante;
    private javax.swing.JTextField novoEnderecoParticipante;
    private javax.swing.JTextField novoNomeParticipante;
    private javax.swing.JTextField novoTelefoneParticipante;
    private javax.swing.JComboBox nroInscrCombo;
    private javax.swing.JTextField telefoneParticipante1;
    // End of variables declaration//GEN-END:variables
}
